home *** CD-ROM | disk | FTP | other *** search
/ The Very Best of Atari Inside / The Very Best of Atari Inside 1.iso / sharew / accs / cal47 / cal47.doc next >
Encoding:
Text File  |  1991-03-16  |  18.6 KB  |  349 lines

  1.                          Cal: The Calendar Program v4.7
  2.                         Copyright (c)1991 by Bill Aycock
  3.  
  4.  
  5. Ever forgotten your anniversary or your kid's birthday? Missed a TV show
  6. because you didn't remember what day it was on? Went to work an hour late when
  7. you forgot to reset your clock for Daylight Savings Time? If this has happened
  8. to you, Cal may be able to help!
  9.  
  10. Cal is a calendar program with a difference - it lets you attach 'events' to
  11. any day of the year, either by date or according to a day's position in the
  12. month. When Cal loads, it reads the current date from your system clock and
  13. checks to see if any significant events are scheduled for the day. If so, Cal
  14. displays an alert that shows you the day's events. (When Cal loads as an ACC,
  15. it dings the system bell if a significant event is scheduled.)
  16.  
  17. Also included in this ARC file is a new version of CalShow, an AUTO program
  18. that will read the events from Cal, display the next 22 events on screen, then
  19. pause so you can easily see what's on tap for the next couple weeks. This
  20. should give you plenty of time to plan for upcoming events! (Note, you must
  21. replace your old version of CalShow with this version. See the separate CalShow
  22. doc file for more information.)
  23.  
  24. Cal comes ready to go, pre-configured with seven dozen commonplace and
  25. obscure events. To use Cal, either install it as a desk accessory in the normal
  26. fashion, or just run it as a program. Cal uses around 37K of memory, and runs
  27. on any ST or TT in any resolution.
  28.  
  29.  
  30. * The main screen: looking at a specific month and year
  31.  
  32.  
  33. Most of the main screen is taken up with the calendar display. There are
  34. twelve small buttons under this display that allow you to see the calendar of
  35. any month in the year; just click the appropriate button. If you double-click
  36. one of these buttons, the calendar display will change to that month of the
  37. current year.
  38.  
  39. To the right of the calendar is a box that tells which month and year the
  40. calendar is showing. The six buttons under this box let you skip forward and
  41. back in one, ten, or hundred-year increments. (You can double-click on the
  42. hundreds buttons to move a thousand years at a time.) Also, if you click on the
  43. year number you can enter a specific year for Cal to display.
  44.  
  45. Underneath the six year buttons are two small words, PREV and NEXT. You can
  46. click on these words to move forward or back one month at a time. The display
  47. will wrap around the end of a year; for example, if you are looking at December
  48. and click NEXT, you'll see January of the following year.
  49.  
  50. Three large buttons appear at the bottom of the main screen. If you click the
  51. Today button while looking at the current month, Cal will display today's Day
  52. Alert, showing you the day of the year and any events scheduled for today. If
  53. you're looking at a different month when you click Today, Cal will simply
  54. display the current month. The Browse button will take you to the Browse dialog
  55. (see below for more information on browsing events). To exit Cal, click the
  56. Exit button or simply hit Return.
  57.  
  58.  
  59. * Different types of days
  60.  
  61.  
  62. The days in the calendar display come in four varieties. If Cal is showing
  63. the calendar of the current month and year, then today's date will be
  64. outlined. Days which are highlighted (i.e., white numbers on a black
  65. background) indicate that special events are scheduled on those days. Normal
  66. black-on-white numbers are simply days of the month which do not have events
  67. attached. Days in the preceding and following months are grayed out.
  68.  
  69.  
  70. * Looking at a specific day and its events
  71.  
  72.  
  73. To look at a specific day more closely, simply click on its date in the
  74. calendar. This brings up the Day Alert screen. The top of this screen displays
  75. the day of the week and the date, the day of the year, and how many days are
  76. left in the year. Underneath this is a box which tells you of any events
  77. scheduled on the day. Up to four messages can appear in this box. If there are
  78. more than four events scheduled for the day, you can click the button labelled
  79. "next page" to see the next group of four events. The list of events 'wraps
  80. around' at the end. For example, if you have six events for one day, the first
  81. four are shown first. Click "next page" and Cal will show you the fifth and
  82. sixth events, plus the first two.
  83.  
  84. Note: Cal will display at most 50 events for a single day, only 45 of which
  85. can be date events. If you find that this is too limiting, split your events
  86. between two copies of Cal.
  87.  
  88. To change one of the day's events (or add a new event for the day), simply
  89. click directly on the text of a message. If you do so, you'll move to the Edit
  90. dialog with that particular event selected. (See the next section for more
  91. information on editing events.)
  92.  
  93. You can click the Exit button (or hit Return) to return to the main calendar
  94. display from the Day Alert.
  95.  
  96.  
  97. * Entering, editing, and deleting events
  98.  
  99.  
  100. The Edit dialog allows you to edit existing events or enter new events. This
  101. dialog has two separate 'modes' - you may edit events either By Date or By
  102. Position. The two large buttons at the top of the screen let you switch between
  103. these two modes. The only difference between the two is that in Date mode, you
  104. see a space where you can enter a specific day of the month and year, but in
  105. Position mode you see two rows of buttons that let you specify a particular
  106. position in the month (e.g., the fourth Thursday). Both modes include buttons
  107. for you to select a particular month or specify that an event is 'significant',
  108. a space for you to enter a message for an event, and a number of action buttons
  109. across the bottom of the screen.
  110.  
  111. There are two ways to get to the Edit dialog: you can click on the text of a
  112. message from the Day Alert, or you can click the Edit button from the Browse
  113. dialog (more on that later). If you enter the Edit dialog by selecting a date
  114. event, you start out in Date mode; if you select a positional event instead,
  115. then you start in Position mode. In any case, the Edit dialog is preset to the
  116. day you were looking at.
  117.  
  118. To add a new event, first indicate when the event occurs by selecting a month
  119. and entering a date or selecting a position. Then click the By Date or By
  120. Position button at the top of the screen to have Cal update the display. Cal
  121. will look at the date or position you entered and cycle through all the events
  122. scheduled for that day. This step is especially important before you erase or
  123. replace an event; if you select a different month or day, always let Cal know
  124. by clicking one of these buttons, or you may erase or replace the wrong event!
  125.  
  126. After you've selected the right schedule, decide if your new event is
  127. 'significant' or not, and select the proper significance button (to the left of
  128. the month buttons). These buttons won't affect how Cal handles the event, but
  129. if an event is NOT significant, then CalShow won't normally display the event
  130. in its list. (You can tell CalShow to include the event by including the "a"
  131. command-line option; see the CalShow documentation for more information.)
  132.  
  133. If you are in Date mode, you can tell Cal that an event will only occur once
  134. by typing a year in the space provided. This can be handy for remembering a
  135. meeting, dentist appointment, or other similar event. Once the event has
  136. expired (i.e., when the event's date has passed), Cal will automatically erase
  137. the event for you. (You can also configure Cal to ask you before it erases an
  138. expired event, or to do nothing to expired events - see the section about
  139. One-Time events below.) If you define a one-time event, it will only show up on
  140. the Day Alert when you're looking at that specific year. (All events, including
  141. one-time events, will still show up when you browse.)
  142.  
  143. Once you've selected the right schedule and significance buttons, add a new
  144. event by typing a short message in the space provided. When you're done, click
  145. the Add button to store your event in memory. To _replace_ an event with a new
  146. message, click the Replace button (marked "repl") instead.
  147.  
  148. If you want to erase an event, click the Erase button at the bottom of the
  149. screen. This brings up a dialog that lets you erase the event you're editing,
  150. all events in that month, or all the events stored in Cal. Select the
  151. appropriate button, then click the Erase Events button, or the Cancel button if
  152. you change your mind. If you choose to erase all events or an entire month's
  153. events, you'll be asked to verify your decision before the events are erased.
  154.  
  155. When you've finished editing the events, click the Save button at the bottom
  156. of the screen - this gives you a chance to locate the Cal program file and save
  157. your changes. When you've finished saving, click the Exit button (or hit
  158. Return) to exit the Edit dialog. (If you prefer, you don't have to save your
  159. changes as soon as you finish editing events. If you make any changes to events
  160. or to your Cal setup, then try to exit Cal without having saved the changes,
  161. you'll see an alert giving you the chance to "save, resume, or exit". Select
  162. "save" if you want to store your changes into Cal, "exit" if you want to exit
  163. Cal without saving the changes you made, or "resume"  to return to the main
  164. calendar screen.)
  165.  
  166. Note: if you upgrade to a newer version of Cal, you WON'T need to type in all
  167. your events again! Simply run your old version of Cal, go to the Edit screen,
  168. and select Save. When the file selector comes up, select the new version of Cal
  169. and save your events. Side note: one of the items Cal saves is the title bar
  170. and Desk menu entry... this means that when you run the new copy of Cal, the
  171. old title bar will show up. Unless you've customized your title, you may want
  172. to update the title to show the new version number; see the section below on
  173. customizing Cal for information on how to do this.
  174.  
  175.  
  176. * Browsing through the events
  177.  
  178.  
  179. To inspect all the events stored in Cal, click the Browse button from the
  180. main calendar screen. This will take you to the Browse dialog, where you can
  181. look through your events starting with the month shown on the calendar screen.
  182. Events are displayed in chronological order, with all the positional events for
  183. a month shown before the date events. If a number of events are scheduled for
  184. the same day, they are shown in alphabetical order.
  185.  
  186. The top of the Browse dialog tells you how many of each type of event there
  187. are and the total number of events. Under that is a box that lists which event
  188. you're looking at, whether it's a Date event, a one-time event, or a Positional
  189. event, and when the event occurs. The next box displays the message for the
  190. current event.
  191.  
  192. Under this display are two rows of buttons. Four of the buttons let you move
  193. through the events on file - First and Last take you to the beginning or end of
  194. the events, and Next and Previous move you forward or back one event at a time.
  195. You can double-click the Next and Previous buttons to move ten events at a
  196. time. Note: the Next button is the default button, so you can move ahead one
  197. event by simply hitting Return. To exit the Browse dialog, you must either
  198. click the EXIT button or hold down the Alternate key when you press Return.
  199.  
  200. The Find button gives you a chance to enter a character string and search
  201. through the events to find one which contains that string. The search starts at
  202. the event following the one you're browsing, wraps around to the beginning, and
  203. ends back at the current event if no match is found. By default, the search is
  204. not case-sensitive; if you want to change this, select the "case sensitive"
  205. button. You may also restrict the search to a particular type of event (i.e., a
  206. positional, one-time, or recurring event or some combination) or to significant
  207. events only; to do so, select the appropriate buttons in the lower box.
  208.  
  209. The Erase button lets you remove the event you're currently browsing, one
  210. month's events, or all events. The Edit button takes you to the Edit dialog
  211. with everything preset to the event you're browsing.
  212.  
  213.  
  214. * One-Time events
  215.  
  216.  
  217. When Cal starts up, it reads the current date from your system's clock. If
  218. you've scheduled a one-time event for a particular date and year, and Cal finds
  219. that that date has passed, it realizes that the event has 'expired'. When this
  220. occurs, Cal will display the Expired Event alert.
  221.  
  222. Cal shows you the event and asks if you want it erased or converted to a
  223. yearly event. Select the appropriate button, then click the Accept button.
  224. If you'd rather wait until later to decide, you can click Skip to move on to
  225. the next expired event. You can also click the Cancel button to skip over all
  226. expired events at once. Any expired events that you skip will still be waiting
  227. for you next time you start Cal.
  228.  
  229. If you prefer, you can have Cal automatically erase expired events without
  230. asking about each one, or do nothing when an event expires. To set this up, use
  231. the Preferences dialog to customize Cal's behaviour.
  232.  
  233. Note: when Cal erases expired events for you automatically, it sets a flag to
  234. show that your setup has changed. If you try to exit Cal without having saved
  235. your setup after this occurs, you'll see the alert telling you that you need to
  236. save the setup. If you see this alert but you haven't changed any events or
  237. preferences, don't be alarmed; it's due to expired events being erased.
  238.  
  239.  
  240. * Preferences: Customizing Cal
  241.  
  242.  
  243. You have the option of customizing several aspects of Cal's behaviour. You
  244. can specify the Desk menu entry Cal will use when running as an accessory,
  245. change how Cal handles expired events, and decide whether or not Cal draws
  246. grow/shrink boxes or displays alerts when you add, replace, or erase events.
  247.  
  248. To change any of these items, click on the large title bar at the top of the
  249. main calendar screen. When the dialog appears, select the radio buttons for
  250. the features you want activated. If you wish, type in a new Desk menu entry.
  251. When you finish selecting your preferences, click the "accept" button or just
  252. hit Return. If you decide not to make any changes, click the "cancel" button
  253. to return to the main screen.
  254.  
  255. After you change any of these settings, be sure to save your new setup,
  256. either from the Edit dialog or when exiting the program.
  257.  
  258.  
  259. * Technical stuff
  260.  
  261.  
  262. CalShow can provide a simple printout of upcoming events, but there is
  263. currently no way to print out a pretty, formatted list. In case someone wants
  264. to write such a program, I'm providing the format of Cal's event database. The
  265. following data is stored in Cal, starting at an offset of $36 bytes from the
  266. beginning of the file...
  267.  
  268.     4 bytes     "ca31"  identifier, shows this is Cal
  269.     1 long       6000   the current amount of space for event storage
  270.     14 bytes     ...    the last filename used when saving data
  271.     1 word       ...    the offset from the start of the message area
  272.                           to the beginning of the unused part
  273.     6000 bytes   ...    the message area itself (see below)
  274.     6 bytes      ...    reserved; flags, etc.
  275.     18 bytes     ...    the current title bar/Desk menu entry
  276.  
  277. Each event is stored in the message area, and has this format:
  278.  
  279.       offset 0   word   offset to next event entry
  280.       offset 2   byte   event date (1..31) or zero if a positional event
  281.       offset 3   byte   month of event (1..12)
  282.   NOTE: the high bit of the month is SET if the event is NOT significant
  283.       offset 4   byte   week position (0-4=weeks 1-5, 5=last, 6=each)
  284.       offset 5   byte   weekday (0=Sunday, 1=Monday ... 6=Saturday)
  285.   OR: offset 4   word   year for a one-time date event
  286.       offset 6   ....   the actual message, a null-terminated string
  287.  
  288. If anyone decides to write a pretty-print program for upcoming events, please
  289. let me know!
  290.  
  291.  
  292. * Credits and a postcardware plea
  293.  
  294.  
  295. Cal and CalShow were written completely in assembly language using the HiSoft
  296. DevpacST assembler. Cal's resource was created with WERCS, and converted to
  297. assembly code using a program written by Carl Barron. Thanks to the following
  298. people for beta testing and some great suggestions: Robert Birmingham, Keith
  299. Joins, Jimmy Long, Jim Ness, Rob Rasmussen, Ray Mattera, Bob Schulze, Jody
  300. Golick, Thomas Miller, Phil Vaughan, Malcolm McMahon, Mike Squire, Mickey Boyd
  301.  
  302. The calendar routine I use in Cal was based on Zeller's Congruence, which
  303. explains a simple way to calculate the day of the week for a given date without
  304. resorting to a lookup table. Articles dealing with this subject appeared in
  305. Computer Language Magazine, March and December 1988. (The articles were
  306. helpful, although they included a couple of typographical errors. :-) Also note
  307. that the modern calendar wasn't invented until the 1580s, something to keep in
  308. mind if you're poking around in the dim and distant past <grin>.
  309.  
  310. Please let me know if you use this program!!! Comments, bug reports,
  311. suggestions, and requests are all welcome. If you need a version of Cal with
  312. more storage room for events, I'd be glad to assemble one for you. Donations
  313. are gratefully accepted - but even if you don't want to contribute, please
  314. send me a postcard at the address below!
  315.  
  316.  
  317.       Bill Aycock
  318.       2310 North Elm Street
  319.       Greensboro, NC 27408
  320.  
  321.       Compuserve ID: 76703,4061
  322.       March 17, 1991
  323.  
  324. -------------------------------
  325. version history:
  326. v4.7: added support for significant/non-significant events
  327. v4.5: added multiple positional events; when saving setup, file selector now
  328.       defaults to path Cal loaded from; allow more events on single day; added
  329.       code to help guard against unusual March start date problem
  330. v4.4: added option to supress add/replace/erase event alerts; added case
  331.       sensitive search, retains search string between searches
  332. v4.3: fixed a logic bug occurring when exiting Cal in some circumstances;
  333.       added keyboard exit from Browse screen
  334. v4.2: added Replace button in Edit; added option to ignore expired events;
  335.       added type filters to Find function; changed Browse logic
  336. v4.1: added grow/shrink box support; added leap-year check for one-time
  337.       events on Feb 29; skip saving duplicate events; sundry other tweaks
  338. v4.0: added multiple events on the same date; added alphabetic sort; added
  339.       one-time events and expired-event handling; various other tweaks
  340. v3.5: fixed filepath setup for standard GEM file selector problem
  341. v3.4: fixed logic error in CalShow; enabled 'last' week position button
  342. v3.3: fixed obscure bug in Find function; redesigned Browse screen and Today
  343.       button logic; added Prev and Next month buttons; added option to save
  344.       changed setup when exiting
  345. v3.2: fixed occasional bus errors after erasing events and then browsing;
  346.       included CalShow for bootup reminders
  347. v3.1: first released version supporting events
  348. v2.0: final calendar-only version
  349.